<template>
  <div class="row containerTop">
    <div class="topTags col-md-6" style="width:67%">
      <el-tag
        v-for="(tag, id) in articletype"
        :key="id"
        @click.native="changeTag(id)"
        :class=" id == currentId ? 'topTag tagSeleted' : 'topTag'"
      >{{tag.type}}</el-tag>
    </div>
    <div class="topBtns col">
      <div class="pull-right">
        <router-link
          :to="{ name:'posted' }"
          class="btn btn-primary imgFabu"
          icon="el-icon-edit-outline"
        >发布帖子</router-link>
      </div>
      <div class="clearfix"></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "fprumtag",
  data() {
    return {
      findForum: "",
      currentId: 0,
      articletype: [
        {
          id: 0,
          type: "全部"
        },
        {
          id: 1,
          type: "最新"
        },
        {
          id: 2,
          type: "最热"
        },
        {
          id: 3,
          type: "推荐"
        },
      ]
    };
  },
  methods: {
    changeTag(id) {
      this.currentId = id;
      this.$router.push({ name: "forum", query: { id } });
    }
  }
};
</script>

<style lang="scss" scoped>
.containerTop {
  background: #F1F1F1;
}

.topTag {
  cursor: pointer;
}

.search {
  background-color:  #40CBF2;
  border-radius: 0 20px 20px 0;
  width: 75px;
  height: 38px;
}
.search-icon {
  line-height: 38px;
  color: #ffffff;
  width: 100%;
  font-size: 32px;
  cursor: pointer;
}
.imgFabu {
  width: 100%;
  height: 38px;
}

.tagSeleted {
  color: #fff !important;
  background: #40cbf2 !important;
}
</style>
